package com.example.object;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class Luminaires {
	String Action;
	String Address;
	String Branch_ID;
	String Branch_Index;
	String Branch_Name;
	String Capacity;
	String Enterprise_ID;
	String Enterprise_Name;
	String ID_Index;
	String ImageLink;
	String Installed_Time;
	String IsActive;
	String Lat;
	String Long;
	String Longevity;
	String Luminaire_Capacity_ID;
	String Luminaire_ID;
	String Luminaire_ID_MAP;
	String Luminaire_Name;
	String Luminaire_Type_ID;
	String Luminaire_Type_Name;
	String Panel_ID;
	String Panel_Name;
	String Pole_ID;
	String Pole_Name;
	String Status_ID;
	String Status_Name;
	String X;
	String Y;
	
	public String getAction() {
		return Action;
	}

	public void setAction(String action) {
		Action = action;
	}

	public String getAddress() {
		return Address;
	}

	public void setAddress(String address) {
		Address = address;
	}

	public String getBranch_ID() {
		return Branch_ID;
	}

	public void setBranch_ID(String branch_ID) {
		Branch_ID = branch_ID;
	}

	public String getBranch_Index() {
		return Branch_Index;
	}

	public void setBranch_Index(String branch_Index) {
		Branch_Index = branch_Index;
	}

	public String getBranch_Name() {
		return Branch_Name;
	}

	public void setBranch_Name(String branch_Name) {
		Branch_Name = branch_Name;
	}

	public String getCapacity() {
		return Capacity;
	}

	public void setCapacity(String capacity) {
		Capacity = capacity;
	}

	public String getEnterprise_ID() {
		return Enterprise_ID;
	}

	public void setEnterprise_ID(String enterprise_ID) {
		Enterprise_ID = enterprise_ID;
	}

	public String getEnterprise_Name() {
		return Enterprise_Name;
	}

	public void setEnterprise_Name(String enterprise_Name) {
		Enterprise_Name = enterprise_Name;
	}

	public String getID_Index() {
		return ID_Index;
	}

	public void setID_Index(String iD_Index) {
		ID_Index = iD_Index;
	}

	public String getImageLink() {
		return ImageLink;
	}

	public void setImageLink(String imageLink) {
		ImageLink = imageLink;
	}

	public String getInstalled_Time() {
		return Installed_Time;
	}

	public void setInstalled_Time(String installed_Time) {
		Installed_Time = installed_Time;
	}

	public String getIsActive() {
		return IsActive;
	}

	public void setIsActive(String isActive) {
		IsActive = isActive;
	}

	public String getLat() {
		return Lat;
	}

	public void setLat(String lat) {
		Lat = lat;
	}

	public String getLong() {
		return Long;
	}

	public void setLong(String l) {
		Long = l;
	}

	public String getLongevity() {
		return Longevity;
	}

	public void setLongevity(String longevity) {
		Longevity = longevity;
	}

	public String getLuminaire_Capacity_ID() {
		return Luminaire_Capacity_ID;
	}

	public void setLuminaire_Capacity_ID(String luminaire_Capacity_ID) {
		Luminaire_Capacity_ID = luminaire_Capacity_ID;
	}

	public String getLuminaire_ID() {
		return Luminaire_ID;
	}

	public void setLuminaire_ID(String luminaire_ID) {
		Luminaire_ID = luminaire_ID;
	}

	public String getLuminaire_ID_MAP() {
		return Luminaire_ID_MAP;
	}

	public void setLuminaire_ID_MAP(String luminaire_ID_MAP) {
		Luminaire_ID_MAP = luminaire_ID_MAP;
	}

	public String getLuminaire_Name() {
		return Luminaire_Name;
	}

	public void setLuminaire_Name(String luminaire_Name) {
		Luminaire_Name = luminaire_Name;
	}

	public String getLuminaire_Type_ID() {
		return Luminaire_Type_ID;
	}

	public void setLuminaire_Type_ID(String luminaire_Type_ID) {
		Luminaire_Type_ID = luminaire_Type_ID;
	}

	public String getLuminaire_Type_Name() {
		return Luminaire_Type_Name;
	}

	public void setLuminaire_Type_Name(String luminaire_Type_Name) {
		Luminaire_Type_Name = luminaire_Type_Name;
	}

	public String getPanel_ID() {
		return Panel_ID;
	}

	public void setPanel_ID(String panel_ID) {
		Panel_ID = panel_ID;
	}

	public String getPanel_Name() {
		return Panel_Name;
	}

	public void setPanel_Name(String panel_Name) {
		Panel_Name = panel_Name;
	}

	public String getPole_ID() {
		return Pole_ID;
	}

	public void setPole_ID(String pole_ID) {
		Pole_ID = pole_ID;
	}

	public String getPole_Name() {
		return Pole_Name;
	}

	public void setPole_Name(String pole_Name) {
		Pole_Name = pole_Name;
	}

	public String getStatus_ID() {
		return Status_ID;
	}

	public void setStatus_ID(String status_ID) {
		Status_ID = status_ID;
	}

	public String getStatus_Name() {
		return Status_Name;
	}

	public void setStatus_Name(String status_Name) {
		Status_Name = status_Name;
	}

	public String getX() {
		return X;
	}

	public void setX(String x) {
		X = x;
	}

	public String getY() {
		return Y;
	}

	public void setY(String y) {
		Y = y;
	}

	public static ArrayList<Luminaires> getListLumianire(String text) throws JSONException {
		ArrayList<Luminaires> lstLuminare = new ArrayList<Luminaires>();
		JSONArray jArr = new JSONArray(text);
		for (int i = 0; i < jArr.length(); i++) {
			Luminaires lumianire = new Luminaires();
			JSONObject jObj = jArr.getJSONObject(i);
			lumianire.setAction(jObj.getString("Action"));
			lumianire.setAddress(jObj.getString("Address"));
			lumianire.setBranch_ID(jObj.getString("Branch_ID"));
			lumianire.setBranch_Index(jObj.getString("Branch_Index"));
			lumianire.setBranch_Name(jObj.getString("Branch_Name"));
			lumianire.setCapacity(jObj.getString("Capacity"));
			lumianire.setEnterprise_ID(jObj.getString("Enterprise_ID"));
			lumianire.setEnterprise_Name(jObj.getString("Enterprise_Name"));
			lumianire.setID_Index(jObj.getString("ID_Index"));
			lumianire.setImageLink(jObj.getString("ImageLink"));
			lumianire.setInstalled_Time(jObj.getString("Installed_Time"));
			lumianire.setIsActive(jObj.getString("IsActive"));
			lumianire.setLat(jObj.getString("Lat"));
			lumianire.setLong(jObj.getString("Long"));
			lumianire.setLongevity(jObj.getString("Longevity"));
			lumianire.setLuminaire_Capacity_ID(jObj.getString("Luminaire_Capacity_ID"));		
			lumianire.setLuminaire_ID(jObj.getString("Luminaire_ID"));
			lumianire.setLuminaire_ID_MAP(jObj.getString("Luminaire_ID_MAP"));
			lumianire.setLuminaire_Name(jObj.getString("Luminaire_Name"));
			lumianire.setLuminaire_Type_ID(jObj.getString("Luminaire_Type_ID"));
			lumianire.setLuminaire_Type_Name(jObj.getString("Luminaire_Type_Name"));
			lumianire.setPanel_ID(jObj.getString("Panel_ID"));
			lumianire.setPanel_Name(jObj.getString("Panel_Name"));
			lumianire.setPole_ID(jObj.getString("Pole_ID"));
			lumianire.setPole_Name(jObj.getString("Pole_Name"));
			lumianire.setStatus_ID(jObj.getString("Status_ID"));
			lumianire.setStatus_Name(jObj.getString("Status_Name"));
			lumianire.setLuminaire_Capacity_ID(jObj.getString("X"));
			lumianire.setX(jObj.getString("Y"));
			lumianire.setY(jObj.getString("IsActive"));
			lstLuminare.add(lumianire);
		}
		return lstLuminare;
	}

}
